topology2: sdw-jack-generic: Make BE DAI and copiers honor SDW_JACK_C…#11036
topology2: sdw-jack-generic: Make BE DAI and copiers honor SDW_JACK_C…#11036rfvirgil wants to merge 1 commit into
Conversation
f968c19 to
91318ce
Compare
There was a problem hiding this comment.
Pull request overview
This PR updates the topology2 Intel SoundWire “sdw-jack-generic” platform configuration to correctly honor SDW_JACK_CAPTURE_CH for jack capture, addressing failures when the codec capture datapath only supports mono (e.g., CS42L42 DP0).
Changes:
- Set the capture BE DAI channel count from a hardcoded
2to$SDW_JACK_CAPTURE_CH. - Propagate
$SDW_JACK_CAPTURE_CHinto the host-gateway capture copier output audio formats. - Propagate
$SDW_JACK_CAPTURE_CHinto the capture ALH copier input audio format.
Comments suppressed due to low confidence (1)
tools/topology/topology2/platform/intel/sdw-jack-generic.conf:391
out_sample_typeis set to UNSIGNED_INTEGER butout_fmt_cfgis computed without incorporating the sample type, diverging from the defaultout_fmt_cfgexpression intools/topology/topology2/include/common/output_audio_format.conf:134. This can generate an incorrect format config for non-integer sample types.
out_fmt_cfg "$[($out_channels | ($out_valid_bit_depth * 256))]"
| out_bit_depth 32 | ||
| out_valid_bit_depth 32 | ||
| out_sample_type $SAMPLE_TYPE_FLOAT | ||
| out_fmt_cfg "$[($out_channels | ($out_valid_bit_depth * 256))]" |
| in_rate $JACK_RATE | ||
| in_channels $SDW_JACK_CAPTURE_CH | ||
| in_bit_depth 32 | ||
| in_valid_bit_depth $SDW_LINK_VALID_BITS | ||
| in_sample_type $SAMPLE_TYPE_MSB_INTEGER |
|
@bardliao For the last Copilot issue:
I tried setting the out_channels of the alh-copier but then I got corrupted audio, even if I also set out_fmt_cfg. |
Yeah, I think other components work with 2 channels. So we need to do 4 ch -> 2 ch convert in the copier. @singalsu Am I correct? |
…URE_CH The BE DAI and all widgets in the capture path should honor the number of capture channels set by SDW_JACK_CAPTURE_CH. Before this change, the value of SDW_JACK_CAPTURE_CH only affected the min/max channels of the FE DAI but all the other widgets in the pipeline were defaulting to 2-channel. Because of this, the codec DAI was always asked for a 2-channel capture, which won't work on codecs that only support 1 channel. And the host-copier output was 2-channel audio that could not be connected to the 1-channel DAI. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
91318ce to
839185b
Compare
|
It turns out that setting in_fmt/out_fmt is a red herring that causes more problems than it fixes. The correct fix seems to be setting [in|out]_ch_map and [in|out]_ch_cfg, and then I can hook everything together with functioning audio. |
CS42L42 capture DP only has 1 channel.
Jack capture was not working on CS42L42 even with SDW_JACK_CAPTURE_CH=1. This was because the simple-jack tplg did not apply SDW_JACK_CAPTURE_CH to the BE DAI or copiers. The result was that SOF/ASoC would attempt to open a 2-channel stream, which would then fail to prepare because DP0.ch1 does not exist.